package string;

public class StringBuilderDemo {
    public static void main(String[] args) {
//        StringBuilder builder1=new StringBuilder();
//        StringBuilder builder2=new StringBuilder("abc");
//
//        //String he StringBuilder
//        String str="abc";
//        StringBuilder builder3=new StringBuilder(str);
//        String str2=builder3.toString();
//

        String str="好好学习Java,";
        StringBuilder builder=new StringBuilder(str);

        builder.append("为了获得高薪");
        System.out.println(builder);

        builder.replace(9,18,"因为需要一份稳定工作");
        System.out.println(builder);

        builder.insert(3,"天天");
        System.out.println(builder);

        builder.delete(4,6);
        System.out.println(builder);

        builder.insert(0,"好好");
        System.out.println(builder);


    }
}
